// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router.js';
//全局引入ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios';
import VueAxios from 'vue-axios';
//配置请求的根路劲
axios.defaults.baseURL='http://rambuild.cn:8888/api/private/v1/';
//axios请求拦截器
axios.interceptors.request.use(config =>{
  console.log(config)
  config.headers.Authorization = window.sessionStorage.getItem('token');
  return config
});
//axios响应拦截
// axios.interceptors.reponse.use(response =>{
//   console.log(response);
//   return response
// },function(error){
//   console.log(error)
// })
Vue.prototype.$http = axios;
import $ from 'jquery';
//导入全局样式表
import  './assets/css/global.css';
//使用ElementUI
Vue.use(ElementUI ,  VueAxios)
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
